Use gsk_rounded_rect_path() instead.
That's a private GSK function, be we can just include its header.
#include "gtkrenderprivate.h"
#include "gtkpango.h"
+#include "gsk/gskroundedrectprivate.h"
+
#include <math.h>
struct _GtkCssValue {
shadow_cr = cr;
cairo_set_fill_rule (shadow_cr, CAIRO_FILL_RULE_EVEN_ODD);
- _gtk_rounded_box_path (box, shadow_cr);
+ gsk_rounded_rect_path (box, shadow_cr);
if (shadow->inset)
_gtk_rounded_box_clip_path (clip_box, shadow_cr);
mask_cr = cairo_create (mask);
_gtk_rounded_box_init_rect (&corner_box, clip_radius, clip_radius, 2*drawn_rect->width, 2*drawn_rect->height);
corner_box.corner[0] = box->corner[corner];
- _gtk_rounded_box_path (&corner_box, mask_cr);
+ gsk_rounded_rect_path (&corner_box, mask_cr);
cairo_fill (mask_cr);
_gtk_cairo_blur_surface (mask, radius, GTK_BLUR_X | GTK_BLUR_Y);
cairo_destroy (mask_cr);
if (shadow->inset)
{
- _gtk_rounded_box_path (padding_box, cr);
+ gsk_rounded_rect_path (padding_box, cr);
cairo_clip (cr);
}
else
{
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
- _gtk_rounded_box_path (padding_box, cr);
+ gsk_rounded_rect_path (padding_box, cr);
outside = spread + clip_radius + MAX (fabs (x), fabs (y));
clip_box = *padding_box;
_gtk_rounded_box_grow (&clip_box, outside, outside, outside, outside);
#include "gtkprogresstrackerprivate.h"
#include "gtksettingsprivate.h"
+#include "gsk/gskroundedrectprivate.h"
+
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
#endif
_gtk_rounded_box_apply_border_radius_for_style (&box,
gtk_style_context_lookup_style (context),
0);
- _gtk_rounded_box_path (&box, cr);
+ gsk_rounded_rect_path (&box, cr);
cairo_fill (cr);
}
#include "gtkrendericonprivate.h"
#include "gtkstylecontextprivate.h"
+#include "gsk/gskroundedrectprivate.h"
+
#include "fallback-c89.c"
static void
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100)
+ _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_PADDING_LEFT), 100));
- _gtk_rounded_box_path (&box, cr);
+ gsk_rounded_rect_path (&box, cr);
}
#include <gdk/gdk.h>
+#include "gsk/gskroundedrectprivate.h"
+
/* this is in case round() is not provided by the compiler,
* such as in the case of C89 compilers, like MSVC
*/
(gtk_css_style_get_value (bg->style, GTK_CSS_PROPERTY_BACKGROUND_CLIP),
n_values - 1));
- _gtk_rounded_box_path (&bg->boxes[clip], cr);
+ gsk_rounded_rect_path (&bg->boxes[clip], cr);
gdk_cairo_set_source_rgba (cr, bg_color);
cairo_fill (cr);
}
cairo_save (cr);
- _gtk_rounded_box_path (
+ gsk_rounded_rect_path (
&bg->boxes[
_gtk_css_area_value_get (
_gtk_css_array_value_get_nth (
#include "gtkhslaprivate.h"
#include "gtkroundedboxprivate.h"
+#include "gsk/gskroundedrectprivate.h"
+
/* this is in case round() is not provided by the compiler,
* such as in the case of C89 compilers, like MSVC
*/
{
gdk_cairo_set_source_rgba (cr, &colors[0]);
- _gtk_rounded_box_path (border_box, cr);
- _gtk_rounded_box_path (&padding_box, cr);
+ gsk_rounded_rect_path (border_box, cr);
+ gsk_rounded_rect_path (&padding_box, cr);
cairo_fill (cr);
}
else
length += _gtk_rounded_box_guess_length (&stroke_box, i);
}
- _gtk_rounded_box_path (&stroke_box, cr);
+ gsk_rounded_rect_path (&stroke_box, cr);
gdk_cairo_set_source_rgba (cr, &colors[0]);
set_stroke_style (cr, border_width[0], stroke_style, length);
cairo_stroke (cr);
cairo_set_matrix (cr, &save);
}
-void
-_gtk_rounded_box_path (const GskRoundedRect *box,
- cairo_t *cr)
-{
- cairo_new_sub_path (cr);
-
- _cairo_ellipsis (cr,
- box->bounds.origin.x + box->corner[GSK_CORNER_TOP_LEFT].width,
- box->bounds.origin.y + box->corner[GSK_CORNER_TOP_LEFT].height,
- box->corner[GSK_CORNER_TOP_LEFT].width,
- box->corner[GSK_CORNER_TOP_LEFT].height,
- G_PI, 3 * G_PI_2);
- _cairo_ellipsis (cr,
- box->bounds.origin.x + box->bounds.size.width - box->corner[GSK_CORNER_TOP_RIGHT].width,
- box->bounds.origin.y + box->corner[GSK_CORNER_TOP_RIGHT].height,
- box->corner[GSK_CORNER_TOP_RIGHT].width,
- box->corner[GSK_CORNER_TOP_RIGHT].height,
- - G_PI_2, 0);
- _cairo_ellipsis (cr,
- box->bounds.origin.x + box->bounds.size.width - box->corner[GSK_CORNER_BOTTOM_RIGHT].width,
- box->bounds.origin.y + box->bounds.size.height - box->corner[GSK_CORNER_BOTTOM_RIGHT].height,
- box->corner[GSK_CORNER_BOTTOM_RIGHT].width,
- box->corner[GSK_CORNER_BOTTOM_RIGHT].height,
- 0, G_PI_2);
- _cairo_ellipsis (cr,
- box->bounds.origin.x + box->corner[GSK_CORNER_BOTTOM_LEFT].width,
- box->bounds.origin.y + box->bounds.size.height - box->corner[GSK_CORNER_BOTTOM_LEFT].height,
- box->corner[GSK_CORNER_BOTTOM_LEFT].width,
- box->corner[GSK_CORNER_BOTTOM_LEFT].height,
- G_PI_2, G_PI);
-
- cairo_close_path (cr);
-}
-
double
_gtk_rounded_box_guess_length (const GskRoundedRect *box,
GtkCssSide side)
double _gtk_rounded_box_guess_length (const GskRoundedRect *box,
GtkCssSide side);
-void _gtk_rounded_box_path (const GskRoundedRect *box,
- cairo_t *cr);
void _gtk_rounded_box_path_side (const GskRoundedRect *box,
cairo_t *cr,
GtkCssSide side);